<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			.b{
				width: 150px;
				height: 100px;
				background: antiquewhite;
				font-size: 30px;
				font-weight: 600;
				float: left;
				margin-left: 100px;
				text-align: center;
				line-height: 100px;
				
			}
		</style>
	</head>
	<body>
		<div class="b"></div>
		<div class="b"></div>
		<div class="b"></div>
		<div class="b"></div>
		<div class="b"></div>
		<script>
			var b = document.getElementsByClassName('b')
			var time=new Date('2021 2-11 18:00:00');
			
			var count_times = setInterval(function (){
				var localtime=new Date();
				var times=time-localtime;
				
				var hao =(times % 1000);
				var sec =parseInt(times / 1000);
				var sescth =(sec % 60);
				var min = parseInt((sec / 60)) % 60;
				var hour =parseInt((sec / 3600)) % 24;
				var days = parseInt((sec / 86400)) % 365;
				
				
				b[0].innerHTML = days + '天';
				b[1].innerHTML = hour + '时';
				b[2].innerHTML = min + '分';
				b[3].innerHTML = sescth + '秒';
				
				
				var res = '';
				if ( hao<10){
					res = '00'+ hao;
					
				}else if (hao >= 10 && hao < 100 ){
					res = '0' + hao;
				} else {
					res = hao;
				}
				b[4].innerHTML = res +'毫秒'
				
			},1)
		</script>
	</body>
</html>
